/** @file letter.h
 */
#ifndef _LETTER_H_
#define _LETTER_H_

extern "C" {
#include "font.h"
}

#include "widget.h"

typedef enum
{
    SIGNAL_LETTER_CHANGED=0,
    SIGNAL_LETTER_MAX
} letter_signal;

class Letter:public Widget
{
public:
    Letter(HWND parent=0, char *text="0");
    ~Letter();
    
    bool isDigit() const;
    void setMode(bool digitMode);
    void setChar(char *c);
    void setFont(FONT *font);
    short sizeX();
    
    Signal signal[SIGNAL_LETTER_MAX];
private:
    int keyShift;///< 3-button to 6 button emulation
    FONT *font;
    bool digitMode;
    char *character;
    void draw(Rect *r);
    virtual int eventHandler(HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);
    void setupWidgets();
};


#endif
